home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / Xteq X-Setup / xqdcXSP-Setup-EN.exe / {app} / plugins / XQ Yahoo Messenger 3.xpl < prev    next >
Text File  |  2001-11-27  |  5KB  |  160 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 6.0"
  2. "TYPE"="8"
  3. "COUNT"="3"
  4. "UIPATH"="Internet\Instant Messaging\Yahoo Messenger"
  5. "NAME"="Custom Status Messages"
  6. "LANGUAGE"="VBScript"
  7. "TEXT 1"="New status..."
  8. "TEXT 2"="Edit status..."
  9. "TEXT 3"="Delete status"
  10. "DESCRIPTION 1"="If you're bored with the status messages Yahoo! gives you by default (Be Right Back, Busy), you can create your own."
  11. "DESCRIPTION 2"="To create a new status, click 'New Status', type in a new message to describe your status (for example Drunk, Insane, Can't Be Bothered), and click OK. Then on the next screen type "0" (without the quotes) if you want this to be an 'active' status and "1" (without the quotes) if you want this to be a 'busy' status. Then click OK."
  12. "DESCRIPTION 3"="You can also edit or delete entries you've already made."
  13. "DESCRIPTION 4"="Notes: You are limited to 5 custom status messages. If you have an older version of Yahoo! Messenger, the settings will affect all users; in more recent versions the settings will only affect the current user."
  14. "DESCRIPTION 5"="Yahoo! Messenger may be obtained at http://messenger.yahoo.com/."
  15. "COMMENT 1"="Thanks to CptSiskoX (CptSiskoX@hotmail.com), AXCEL216, (axcel216@aol.com) and Jesse L Zufall (jzufall@yahoo.com) for this tip."
  16. "VERSION"="1.12"
  17. "AUTHOR"="Xteq Systems (Neil R. Turner)"
  18. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved."
  19. "CONTACTURL"="http://www.xteq.com/"
  20.  
  21. a="HKCU\Software\Yahoo\Pager\"
  22.  
  23. SUB Plugin_Initialize
  24.  k=RegPathExists(a)
  25.  if k=false then
  26.   Call Disable()
  27.  else
  28.   d=RegPathExists(a & "Profiles\")
  29.   if d=true then
  30.    b=RegValueExists(a & "Yahoo! User ID")
  31.    if b=true then
  32.     c=RegReadValue(a & "Yahoo! User ID")
  33.     g=a & "Profiles\" & c & "\"
  34.    end if
  35.   else
  36.    g=a
  37.   end if
  38.   Call ReadMsg(1,g)
  39.   Call ReadMsg(2,g)
  40.   Call ReadMsg(3,g)
  41.   Call ReadMsg(4,g)
  42.   Call ReadMsg(5,g)
  43.  end if
  44. END SUB
  45.  
  46. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  47.  d=RegPathExists(a & "Profiles\")
  48.  if d=true then
  49.   b=RegValueExists(a & "Yahoo! User ID")
  50.   if b=true then
  51.    c=RegReadValue(a & "Yahoo! User ID")
  52.    g=a & "Profiles\" & c & "\"
  53.   end if
  54.  else
  55.   g=a
  56.  end if
  57.  if ElementIndex=1 then ' New entry
  58.   if RegValueExists(g & "Custom Msgs\1")=true AND RegValueExists(g & "Custom Msgs\2")=true AND RegValueExists(g & "Custom Msgs\3")=true AND RegValueExists(g & "Custom Msgs\4")=true AND RegValueExists(g & "Custom Msgs\5")=true then
  59.    Call MsgError("You cannot have more than 5 entries!")
  60.   else
  61.    ' Firstly, we need to find out which value is free (either 1, 2, 3, 4 or 5)
  62.    if RegValueExists(g & "Custom Msgs\1")=false then
  63.     ' We can now use the first value
  64.     Call WriteMsg(1,g)
  65.    else
  66.     if RegValueExists(g & "Custom Msgs\2")=false then
  67.      ' OK, can we use the second value?
  68.      Call WriteMsg(2,g)
  69.     else
  70.      if RegValueExists(g & "Custom Msgs\3")=false then
  71.       ' Well what about the third value?
  72.       Call WriteMsg(3,g)
  73.      else
  74.       if RegValueExists(g & "Custom Msgs\4")=false then
  75.        ' Surely the fourth value?
  76.        Call WriteMsg(4,g)
  77.       else
  78.        if RegValueExists(g & "Custom Msgs\5")=false then
  79.         ' No! Not the fifth value! AAAAAHHHH!
  80.         Call WriteMsg(5,g)
  81.        else
  82.         Call MsgError("You cannot have more than 5 entries!")
  83.        end if ' 1 ..
  84.       end if ' 2 ..
  85.      end if ' 3 ..
  86.     end if ' 4 ..
  87.    end if ' 5 ..
  88.   end if '6 !!! Oh well, it works...
  89.  else
  90.   if ElementSubIndex>0 then
  91.    if ElementIndex=2 then ' Edit status
  92.     Call WriteMsg(ElementSubIndex,g)
  93.    end if
  94.    if ElementIndex=3 then ' Delete Status
  95.     m=RegValueExists(g & "Custom Msgs\" & ElementSubIndex)
  96.     if m=true then
  97.      Call RegDeleteValue(g & "Custom Msgs\" & ElementSubIndex)
  98.     end if
  99.     m=RegValueExists(g & "Custom Msgs\" & ElementSubIndex & "_DND")
  100.     if m=true then
  101.      Call RegDeleteValue(g & "Custom Msgs\" & ElementSubIndex & "_DND")
  102.     end if
  103.     Call SetUIElement(ElementSubIndex,"")
  104.    end if
  105.   else
  106.    Call MsgError("Please select an item first.")
  107.   end if
  108.  end if
  109. END SUB
  110.  
  111. SUB Plugin_Terminate
  112. END SUB
  113.  
  114. SUB WriteMsg(MsgID,UserID)
  115.  d=RegPathExists(a & "Profiles\")
  116.  if d=true then
  117.   b=RegValueExists(a & "Yahoo! User ID")
  118.   if b=true then
  119.    c=RegReadValue(a & "Yahoo! User ID")
  120.    g=a & "Profiles\" & c & "\"
  121.   end if
  122.  else
  123.   g=a
  124.  end if
  125.  l=RegReadValue(g & "Custom Msgs\" & MsgID)
  126.  y=InputWindow("1. Type a description of this status (for example Drunk, Insane, Can't Be Bothered) below",l,1)
  127.  if IsEmpty(y)=false then
  128.   Call RegWriteValue(g & "Custom Msgs\" & MsgID,y,1)
  129.   j=InputWindow("2. Type '0' if you want this to be an 'active' status, type '1' if you want this to be a 'busy' status.","0",1)
  130.   if IsEmpty(j)=false then
  131.    if j="1" then
  132.     Call RegWriteValue(g & "Custom Msgs\" & MsgID & "_DND",1,2)
  133.    else
  134.     Call RegWriteValue(g & "Custom Msgs\" & MsgID & "_DND",0,2)
  135.    end if
  136.    j=RegReadValue(g & "Custom Msgs\" & MsgID & "_DND")
  137.    if j=1 then
  138.     x=" (Busy)"
  139.    else
  140.     x=" (Active)"
  141.    end if
  142.    Call SetUIElement(MsgID,y & x)
  143.   end if
  144.  end if
  145. END SUB
  146.  
  147. SUB ReadMsg(MsgID,UserID)
  148.  f=RegValueExists(UserID & "Custom Msgs\" & MsgID)
  149.  if f=true then
  150.   o=RegReadValue(UserID & "Custom Msgs\" & MsgID)
  151.   p=RegReadValue(UserID & "Custom Msgs\" & MsgID & "_DND")
  152.   if p=0 then
  153.    q="(Active)"
  154.   else
  155.    q="(Busy)"
  156.   end if
  157.   Call SetUIElement(MsgID,o & " " & q)
  158.  end if
  159. END SUB
  160.